

<template>
    <div class="storeInfo supplier">
        <div class="head">
            <el-form class="headForm">
                <!-- <el-button type="success"  @click="theClick">添加</el-button>                -->
            </el-form>
            
        </div> 
        <!-- <p style="line-height:30px;padding-left:20px;margin-top:8px;color:#333" v-if="form.order_id == ''">最近{{total}}笔人工退款订单记录</p> -->
        <!-- table -->
        <div class="tabContainer_SI tabContainer">
            <el-table :data="tableData" stripe style="width: 100%;text-align:center" >
                <!-- 标签序号	标签名称	标签属性描述	更新时间	Pad端显示				 -->
                <el-table-column prop="tag_id" label="标签序号" fixed ></el-table-column>
                <el-table-column prop="name" label="标签名称"> </el-table-column>
                <el-table-column prop="desc" label="标签属性描述" ></el-table-column>
                <el-table-column prop="create_time" label="更新时间"></el-table-column>
                <el-table-column prop="give_num" label="Pad端显示">
                    <template slot-scope="scope">
                        <div @click="ifshow(scope.row)" v-if="scope.row.is_show == 1" style="color:#409EFF;cursor:pointer">显示</div>
                        <div @click="ifshow(scope.row)" v-else style="color:#409EFF;cursor:pointer">不显示</div>
                    </template>
                </el-table-column>    

            </el-table>                       
        </div>
        <!-- 分页部分 -->
        <el-pagination
            background
            layout="total, prev, pager, next, jumper"
            @current-change="changePage"
            :page-size="size"
            :current-page.sync="pageNum"
            :hide-on-single-page=true
            :total="total">{{total}}
        </el-pagination>

    </div>
</template>

<style lang="scss">
.supplier{
        .el-dialog{
            .el-dialog__body{
                min-height: 300px;

            }
        } 
    }
  .tabContainer_SI{
      .el-table{
          .cell{
              text-align: center;
          }
      }
  }
</style>

<script>
import Vue from 'vue';
import { abc } from "../../../../js/abc.js";
import {potUrl} from '../../../../js/config_url.js'; 

export default {
    data () {
    return {
        tableData:[],
        total:50,
        size:20,
        form:{size:20,
            page:1
        },
        pageNum:1

    }
  }, 
   mounted(){
      let that = this;
      that.getList();
      
  },
  methods:{
    search(){
        let that = this;
        //搜索有问题，搜索2019-03数据和2019-04数据是一样的；-error
        that.getList()
    },
    changePage(val){
        var that = this;
        that.pageNum = val;
        that.form.page = val;
        that.getList()
    },
    getList(){
        let that = this;
        abc.get(that,potUrl.backuptaglist,that.form,(res)=>{
            that.tableData=res.data.list;
            that.total = res.data.list.length;
        })//列表
    },
    ifshow(a){
        const that = this;
        abc.post(that,potUrl.backuptagrelation,{tag_id:a.tag_id},()=>{
            a.is_show == 1?a.is_show =0:a.is_show=1;
            that.$message('操作成功')
        })
    }
  }
}
</script>
